package users;

import java.util.List;

import papers.Manuscript;

/**
 * One type of the user, kind of the admin role
 * @author Dickson Kwong
 */

public class ProgramChair extends User{
	
	private static final long serialVersionUID = 1L;


	/* @ requires the_name != null */
	/* @ requires the_emailAddress != null */
	/* @ ensures getName() == the_name @ */
	/* @ ensures getEmail() == the_emailAddress @ */
	/**
	 * Creates a new Program Chair.
	 * @param name The name of this user.
	 * @param the_emailAddress The email address of this user.
	 */
	public ProgramChair(String the_name) {
		super(the_name);
	}
	
	/* @ requires the_name != null */
	/* @ requires the_emailAddress != null */
	/* @ ensures r.getAssignedManuscripts().size() == the_maunscriptList.size() @ */
	/* @ ensures r.getName() == the_name @ */
	/* @ ensures r.getEmail() == the_emailAddress @ */
	/**
	 * Creates a new Reviewer.
	 * @param the_name The name of this user.
	 * @param the_emailAddress The email address of this user.
	 * @return the Reviewer object
	 */
	public Reviewer addReviewer(String the_name) {
		Reviewer r = new Reviewer(the_name);
		return r;
	}
	
	/* @ requires the_name != null */
	/* @ requires the_emailAddress != null */
	/* @ requires the_maunscriptList != null */
	/* @ ensures r.getAssignedManuscripts().contains(the_maunscript) @ */
	/* @ ensures r.getName() == the_name @ */
	/* @ ensures r.getEmail() == the_emailAddress @ */
	/**
	 * Creates a new Reviewer with a manuscript.
	 * @param the_name The name of this user.
	 * @param the_emailAddress The email address of this user.
	 * @param the_maunscript The manuscript. 
	 * @return the Reviewer object
	 */
	public Reviewer addReviewer(String the_name, Manuscript the_maunscript) {
		Reviewer r = addReviewer(the_name);
		r.addAssignedManuscript(the_maunscript);
		return r;
	}
	
	/* @ requires the_name != null */
	/* @ requires the_emailAddress != null */
	/* @ requires the_maunscriptList != null */
	/* @ ensures r.getAssignedManuscripts().size() == the_maunscriptList.size() @ */
	/* @ ensures r.getName() == the_name @ */
	/* @ ensures r.getEmail() == the_emailAddress @ */
	/**
	 * Creates a new Reviewer with a list of manuscript.
	 * @param the_name The name of this user.
	 * @param the_emailAddress The email address of this user.
	 * @param the_maunscriptList The manuscript list
	 * @return the Reviewer object
	 */
	public Reviewer addReviewer(String the_name, List<Manuscript> the_maunscriptList) {
		Reviewer r = addReviewer(the_name);
	
		for(Manuscript manu : the_maunscriptList ){
			r.addAssignedManuscript(manu);
		}

		return r;
	}
	
	/**
	 * Return the user role.
	 * @return the Reviewer object
	 */
	public String getRole(){
		return "Program Chair";
	}
	
	
}
